﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Pie.aspx.cs" Inherits="admin_demo_chart_Pie" %>

<script type="text/javascript">
    $(function () {
        $.AjaxMask({
            url: $.Api("Demo/Chart/Pie"), type: "get", success: function (result) {
                result = JSON.parse(result);
                if (result.length > 0) {
                    result[result.length - 1].sliced = true;
                    result[result.length - 1].selected = true;
                }
                $("#chart-pie").highcharts({
                    chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: false },
                    title: { text: "<b>数据词典内容数量百分比统计</b>" },
                    tooltip: { pointFormat: '{series.name}: <b>{point.y}项</b>' },
                    plotOptions: {
                        pie: {
                            allowPointSelect: true, cursor: 'pointer',
                            dataLabels: {
                                enabled: true, color: '#000000', connectorColor: '#000000',
                                format: '{point.name}: {point.percentage:.2f} %'
                            }
                        }
                    },
                    series: [{ type: 'pie', name: '内容数量', data: result }]
                });
            }
        });
    });
</script>

<div class="easyui-panel" border="false" <%= AttrPanel() %> style="padding:50px;">
    <div id="chart-pie" style="height:100%;"></div>
</div>